
function dic_to_string(dic){
  var retstr = "";
  for (var key in dic) {
    var data = dic[key];
    var val = encodeURIComponent(data);
    retstr = retstr + key + "=" + val + "&";
  }
  if(retstr.endsWith("&")){
    retstr = retstr.substr(0, retstr.length - 1);
  }
  return retstr;
}

module.exports = {
  dic_to_string: dic_to_string
}


